
public class XMIRequirementsHelper{

	public static String getXMIPackageRequirements(){
		StringBuilder sb = new StringBuilder();
		//
		sb.append("				<UML:Package name=\"Requirements\" xmi.id=\"${XMIGenerator.util.nextXmiId}\" isRoot=\"true\" isLeaf=\"false\" isAbstract=\"false\" visibility=\"public\">\r\n");
		sb.append("				<UML:Namespace.ownedElement>\r\n");
		//
		sb.append(getXMIProjectRequirements());
		sb.append(getXMIPersistenceRequirements());
		sb.append(getXMIDomainRequirements());
		sb.append(getXMIWebRequirements());
		//
		sb.append("				</UML:Namespace.ownedElement>\r\n");
		sb.append("				</UML:Package>\r\n");
		//
		return sb.toString();
	}

	public static String getXMIProjectRequirements(){
		StringBuilder sb = new StringBuilder();
		//
		sb.append(getXMIClassHeader("Project"));
		sb.append(XMIClassHelper.getXMIForTaggedValue("project.topLevelPackage","ar.com.coonocer.joy.testproject"));
		sb.append(XMIClassHelper.getXMIForTaggedValue("project.projectName","TestProject"));
		sb.append(XMIClassHelper.getXMIForTaggedValue("project.java","*"));
		sb.append(getXMIClassFooter());
		//
		return sb.toString();
	}

	public static String getXMIPersistenceRequirements(){
		StringBuilder sb = new StringBuilder();
		//
		sb.append(getXMIClassHeader("Persistence"));
		sb.append(XMIClassHelper.getXMIForTaggedValue("persistence.provider","HIBERNATE"));
		sb.append(XMIClassHelper.getXMIForTaggedValue("persistence.database","HYPERSONIC_IN_MEMORY"));
		sb.append(XMIClassHelper.getXMIForTaggedValue("persistence.applicationId","*"));
		sb.append(XMIClassHelper.getXMIForTaggedValue("persistence.jndiDatasource","*"));
		sb.append(XMIClassHelper.getXMIForTaggedValue("persistence.hostName","*"));
		sb.append(XMIClassHelper.getXMIForTaggedValue("persistence.databaseName","*"));
		sb.append(XMIClassHelper.getXMIForTaggedValue("persistence.userName","*"));
		sb.append(XMIClassHelper.getXMIForTaggedValue("persistence.password","*"));
		sb.append(XMIClassHelper.getXMIForTaggedValue("persistence.transactionManager","*"));
		sb.append(XMIClassHelper.getXMIForTaggedValue("persistence.persistenceUnit","*"));
		sb.append(getXMIClassFooter());
		//
		return sb.toString();
	}

	public static String getXMIWebRequirements(){
		StringBuilder sb = new StringBuilder();
		//
		sb.append(getXMIClassHeader("Web"));
		sb.append(XMIClassHelper.getXMIForTaggedValue("web.package","~.web"));
		sb.append(getXMIClassFooter());
		//
		return sb.toString();
	}

		public static String getXMIDomainRequirements(){
		StringBuilder sb = new StringBuilder();
		//
		sb.append(getXMIClassHeader("Domain"));
		sb.append(XMIClassHelper.getXMIForTaggedValue("domain.package","~.domain"));
		sb.append(getXMIClassFooter());
		//
		return sb.toString();
	}

				private static String getXMIClassHeader(String name){
		StringBuilder sb = new StringBuilder();
		//
		sb.append("				<UML:Class name=\""+name+"\" xmi.id=\"${XMIGenerator.util.nextXmiId}\" \r\n");
		sb.append("					visibility=\"public\" isSpecification=\"false\" isRoot=\"false\" \r\n");
		sb.append("					isLeaf=\"false\" isAbstract=\"false\" isActive=\"false\">\r\n");
		//
		sb.append("							<UML:ModelElement.taggedValue>\r\n");
		//
		//
		return sb.toString();
	}

	private static String getXMIClassFooter(){
		StringBuilder sb = new StringBuilder();
		//
		sb.append("							</UML:ModelElement.taggedValue>\r\n");
		//
		sb.append("				</UML:Class>\r\n");
		//
		return sb.toString();
	}
}